package ifosup.thibault.file;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

public class file {

	public static void main(String[] args) throws IOException {
		File rep = new File("repertoiredethibal");
		rep.mkdir();
		File file = new File(rep,"toto.txt");
		System.out.println(rep.getAbsolutePath());
		OutputStream flux = new FileOutputStream(file);
		String s = "Hello World";
		flux.write(s.getBytes());
		flux.close();
		InputStream fluxsortie = new FileInputStream(file);
		int c=0;
		while((c=fluxsortie.read())>0)
		{
		System.out.print((char)c);
		}
		fluxsortie.close();
		file.delete();
		rep.delete();

	}

}
